import dayjs from 'dayjs'

import './index.less'

export const Order = ({ order }) => {
  return (
    <View className="member-order-list">
      {
        order.map(item => (
          <View className="item" key={ item.id }>
            {/* <Image className="state" src={ require('../../assets/images/member_done_icon.png') } /> */}
            <View className="member">
              <Image src={ require('../../assets/images/member_icon.png') } />
              <View>
                <Text>{ item.productName }</Text>
                <Text>有效期：{ dayjs(item.openTime).format('YYYY.MM.DD') }-{ dayjs(item.expiredTime).format('YYYY.MM.DD') }</Text>
                <Text>￥{ item.discountPrice }</Text>
              </View>
            </View>
            <View className="line"></View>
            <View className="text">
              <Text>下单方式</Text>
              <Text>{ item.orderType }</Text>
            </View>
            <View className="text">
              <Text>订单编号</Text>
              <Text>{ item.outTradeNo }</Text>
            </View>
            <View className="text">
              <Text>下单时间</Text>
              <Text>{ item.openTime }</Text>
            </View>
            <View className="line"></View>
            <View className="text">
              <Text>原价</Text>
              <Text>{ item.originalPrice }</Text>
            </View>
            <View className="text">
              <Text>折扣价</Text>
              <Text>{ item.discountPrice }</Text>
            </View>
            <View className="text big" style={{ paddingBottom: '20Px' }}>
              <Text>实付款</Text>
              <Text>￥{ item.payAmount }</Text>
            </View>
            {/* <View className="line"></View>
            <View className="btn">退款</View> */}
          </View>
        ))
      }
    </View>
  )
}

Order.defaultProps = {
  order: []
}